
//定义包对象名字和包名一样
package object chapter04 {
  var name: String = _
  def test():Unit={
  println("9999")
  }
}

package chapter04 {

  object WhileDemo {

    def main(args: Array[String]): Unit = {

      println(name);

      name = "6yu"
      test()
    }
  }
}